package com.eric.study;

import akka.actor.typed.ActorSystem;
import com.eric.study.manager.DeviceManager;

/**
 * <p>
 * APP
 *
 * <p>
 * change history:
 *
 * <pre>
 * date         defect       person          comments
 * --------------------------------------------------------------------------------
 * 2023/8/19    ********     Eric    create file.
 * </pre>
 *
 * @author Eric
 * @date 2023/8/19 14:01
 * @since 1.0.0
 */
public class APP {

    public static void main(String[] args) {
        // Create ActorSystem and top level supervisor
        ActorSystem<DeviceManager.ManagerMessage> deviceManager = ActorSystem.create(DeviceManager.create(), "DeviceManager");

        deviceManager.tell(new DeviceManager.RequestTrackDevice("Eric", "d1", deviceManager.ignoreRef()));
        deviceManager.tell(new DeviceManager.RequestTrackDevice("Eric", "d2", deviceManager.ignoreRef()));
        deviceManager.tell(new DeviceManager.RequestTrackDevice("Eric", "d3", deviceManager.ignoreRef()));

        deviceManager.tell(new DeviceManager.RequestTrackDevice("Tom", "d5", deviceManager.ignoreRef()));
        deviceManager.tell(new DeviceManager.RequestTrackDevice("Tom", "d6", deviceManager.ignoreRef()));
        deviceManager.tell(new DeviceManager.RequestTrackDevice("Tom", "d7", deviceManager.ignoreRef()));

        deviceManager.tell(new DeviceManager.StopDevice(1L, "Eric", "d1"));


    }


}
